<?php
$link =  mysqli_connect("localhost","root","root","2116");

// 每页显示的数量$pageCount
$pageCount = $_GET['count'];

// 总的数据条数
$sql = "SELECT COUNT(*) AS total FROM news";

$res =  mysqli_query($link,$sql);

$arr =  mysqli_fetch_assoc($res);

// print_r($arr);
$total = $arr['total'];

// 计算页码
$p = ceil( $total/$pageCount);
// echo $p;
$info['p'] = $p;
echo json_encode($info);








?>